﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Facebook.Utility;
using Microsoft.Silverlight.Testing;
using Facebook.Rest;
using Facebook.Schema;

namespace Facebook.Tests.Asynchronous
{
	[TestClass]
	public class DashboardTest : AsyncFacebookTest
	{

        ///// <summary>
        /////A test for banUsers
        /////</summary>
        //[TestMethod()]
        //[Asynchronous]
        //public void MultiAddNewsTest()
        //{
        //    var bundle = new dashboard_bundle() { message = "news message" };
        //    var news = new List<dashboard_bundle>();
        //    news.Add(bundle);

        //    _apiWeb.Dashboard.MultiAddNewsAsync(new dashboard_news() { news = news }, new List<long> { Constants.FBSamples_UserId, Constants.FBSamples_friend1 }, MultiAddNewsCompleted, null);
        //    _apiWeb.Dashboard.MultiIncrementCountAsync(new List<long> { Constants.FBSamples_UserId, Constants.FBSamples_friend1 }, MultiIncrementCountCompleted, null);
        //    _apiWeb.Dashboard.MultiGetCountAsync(new List<long> { Constants.FBSamples_UserId, Constants.FBSamples_friend1 }, MultiGetCountCompleted, null);
        //    _apiWeb.Dashboard.MultiDecrementCountAsync(new List<long> { Constants.FBSamples_UserId, Constants.FBSamples_friend1 }, MultiDecrementCountCompleted, null);
        //    _apiWeb.Dashboard.MultiSetCountAsync(new Dictionary<long, long>() { { Constants.FBSamples_UserId, 10 }, { Constants.FBSamples_friend1, 10 } }, MultiSetCountCompleted, null);
        //    _apiWeb.Dashboard.MultiClearNewsAsync(new Dictionary<long, List<string>>() { { Constants.FBSamples_UserId, null }, { Constants.FBSamples_friend1, null } }, MultiClearNewsCompleted, null);
        //    _apiWeb.Dashboard.MultiGetNewsAsync(new Dictionary<long, List<string>>() { { Constants.FBSamples_UserId, null }, { Constants.FBSamples_friend1, null } }, MultiGetNewsCompleted, null);
        //}
        ///// <summary>
        /////A test for banUsers
        /////</summary>
        //[TestMethod()]
        //[Asynchronous]
        //public void ClearNewsTest()
        //{
        //    var bundle = new dashboard_bundle() { message = "news message" };
        //    var news = new List<dashboard_bundle>();
        //    news.Add(bundle);
        //    _apiWeb.Dashboard.AddNewsAsync(new dashboard_news() { news = news }, Constants.FBSamples_UserId, AddNewsCompleted, null);

        //}
        ///// <summary>
        /////A test for banUsers
        /////</summary>
        //[TestMethod()]
        //[Asynchronous]
        //public void ClearGlobalNewsTest()
        //{
        //    var bundle = new dashboard_bundle() { message = "news message" };
        //    var news = new List<dashboard_bundle>();
        //    news.Add(bundle);
        //    _apiWeb.Dashboard.AddGlobalNewsAsync(new dashboard_news() { news = news }, AddGlobalNewsCompleted, null);
        //    _apiWeb.Dashboard.AddNewsAsync(new dashboard_news() { news = news }, Constants.FBSamples_UserId, AddNewsCompleted, null);

        //}
        ///// <summary>
        /////A test for banUsers
        /////</summary>
        //[TestMethod()]
        //[Asynchronous]
        //public void ActivityTest()
        //{
        //    var bundle = new dashboard_bundle()
        //    {
        //        message = "{*actor*} just sponsored @:563683308!",
        //        action_link = new action_link() { href = "http://www.example.com/games?id=5878237", text = "Sponsor this cause" }
        //    };
        //    _apiWeb.Dashboard.PublishActivityAsync(bundle, PublishActivityCompleted, null);

        //}
        /// <summary>
        ///A test for banUsers
        ///</summary>
        [TestMethod()]
        [Asynchronous]
        public void GetNewsTest()
        {
            var bundle = new dashboard_bundle() { message = "news message" };
            var news = new List<dashboard_bundle>();
            news.Add(bundle);
            _apiWeb.Dashboard.AddNewsAsync(new dashboard_news() { news = news }, Constants.FBSamples_UserId, AddNewsCompleted, null);


        }
        private void MultiAddNewsCompleted(Dictionary<string, object> result, Object state, FacebookException e)
		{
		}
        private void MultiIncrementCountCompleted(Dictionary<string, bool> result, Object state, FacebookException e)
        {
        }
        private void GetActivityCompleted(List<dashboard_activity> result, Object state, FacebookException e)
        {
        }
        private void AddNewsCompleted(long result, Object state, FacebookException e)
        {
            _apiWeb.Dashboard.GetNewsAsync(null, Constants.FBSamples_UserId, GetNewsCompleted, null);

        }
        private void GetNewsCompleted(List<dashboard_news> result, Object state, FacebookException e)
        {
            _apiWeb.Dashboard.ClearNewsAsync(new List<long> { long.Parse(result[0].news_id) }, Constants.FBSamples_UserId, ClearNewsCompleted, null);
        }
        private void PublishActivityCompleted(long result, Object state, FacebookException e)
        {
            _apiWeb.Dashboard.GetActivityAsync(null, Constants.FBSamples_UserId, GetActivityCompleted, null);

        }
        private void AddGlobalNewsCompleted(long result, Object state, FacebookException e)
        {
            _apiWeb.Dashboard.ClearGlobalNewsAsync(new List<long> { result }, ClearGlobalNewsCompleted, null);
        }
        private void ClearGlobalNewsCompleted(Dictionary<string, bool> result, Object state, FacebookException e)
        {
        }
        private void ClearNewsCompleted(Dictionary<string, bool> result, Object state, FacebookException e)
        {
        }
        private void MultiGetCountCompleted(Dictionary<string, int> result, Object state, FacebookException e)
        {
        }
        private void MultiDecrementCountCompleted(Dictionary<string, bool> result, Object state, FacebookException e)
        {
        }
        private void MultiGetNewsCompleted(Dictionary<string, List<dashboard_news>> result, Object state, FacebookException e)
        {
        }
        private void MultiSetCountCompleted(Dictionary<string, bool> result, Object state, FacebookException e)
        {
        }
        private void MultiClearNewsCompleted(Dictionary<string, Dictionary<string, object>> result, Object state, FacebookException e)
        {
        }



	}
}
